package org.json;

import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.io.StringWriter;

/**
 * Test class. This file is not formally a member of the org.json library.
 * It is just a casual test tool.
 */
public class Test {

    /**
     * Entry point.
     * @param args
     */
    public static void main(String args[]) {
        Iterator it;
        JSONArray a;
        JSONObject j;
        JSONStringer jj;
        String s;
        
/** 
 *  Obj is a typical class that implements JSONString. It also
 *  provides some beanie methods that can be used to 
 *  construct a JSONObject. It also demonstrates constructing
 *  a JSONObject with an array of names.
 */
        class Obj implements JSONString {
        	public String aString;
        	public double aNumber;
        	public boolean aBoolean;
        	
            public Obj(String string, double n, boolean b) {
                this.aString = string;
                this.aNumber = n;
                this.aBoolean = b;
            }
            
            public double getNumber() {
            	return this.aNumber;
            }
            
            public String getString() {
            	return this.aString;
            }
            
            public boolean isBoolean() {
            	return this.aBoolean;
            }
            
            public String getBENT() {
            	return "All uppercase key";
            }
            
            public String getX() {
            	return "x";
            }
            
            public String toJSONString() {
            	return "{" + JSONObject.quote(this.aString) + ":" + 
            	JSONObject.doubleToString(this.aNumber) + "}";
            }            
            public String toString() {
            	return this.getString() + " " + this.getNumber() + " " + 
            			this.isBoolean() + "." + this.getBENT() + " " + this.getX();
            }
        }      
        
    	Obj obj = new Obj("A beany object", 42, true);
        
        try {     
//            j = XML.toJSONObject("<![CDATA[This is a collection of test patterns and examples for org.json.]]>  Ignore the stuff past the end.  ");
//            System.out.println(j.toString());
//            
//            s = "<div id=\"demo\" class=\"JSONML\"><p>JSONML is a transformation between <b>JSON</b> and <b>XML</b> that preserves ordering of document features.</p><p>JSONML can work with JSON arrays or JSON objects.</p><p>Three<br/>little<br/>words</p></div>";
//            j = JSONML.toJSONObject(s);
//            System.out.println(j.toString(4));
//            System.out.println(JSONML.toString(j));
//            System.out.println();
//            
//            a = JSONML.toJSONArray(s);
//            System.out.println(a.toString(4));
//            System.out.println(JSONML.toString(a));
//            System.out.println();
//            
//            j = new JSONObject(obj);
//            System.out.println(j.toString());
//            
//            s = "{ \"entity\": { \"imageURL\": \"\", \"name\": \"IXXXXXXXXXXXXX\", \"id\": 12336, \"ratingCount\": null, \"averageRating\": null } }";
//            j = new JSONObject(s);
//            System.out.println(j.toString(2));
//
//            jj = new JSONStringer();
//            s = jj
//	            .object()
//	                .key("foo")
//	                .value("bar")
//	                .key("baz")
//	                .array()
//	                    .object()
//	                        .key("quux")
//	                        .value("Thanks, Josh!")
//	                    .endObject()
//	                .endArray()
//	                .key("obj keys")
//	                .value(JSONObject.getNames(obj))
//	            .endObject()
//            .toString();
//            System.out.println(s);
//
//            System.out.println(new JSONStringer()
//                .object()
//                	.key("a")
//                	.array()
//                		.array()
//                			.array()
//                				.value("b")
//                            .endArray()
//                        .endArray()
//                    .endArray()
//                .endObject()
//                .toString());
//
//            jj = new JSONStringer();
//            jj.array();
//            jj.value(1);
//            jj.array();
//            jj.value(null);
//            jj.array();
//            jj.object();
//            jj.key("empty-array").array().endArray();
//            jj.key("answer").value(42);
//            jj.key("null").value(null);
//            jj.key("false").value(false);
//            jj.key("true").value(true);
//            jj.key("big").value(123456789e+88);
//            jj.key("small").value(123456789e-88);
//            jj.key("empty-object").object().endObject();
//            jj.key("long");
//            jj.value(9223372036854775807L);
//            jj.endObject();
//            jj.value("two");
//            jj.endArray();
//            jj.value(true);
//            jj.endArray();
//            jj.value(98.6);
//            jj.value(-100.0);
//            jj.object();
//            jj.endObject();
//            jj.object();
//            jj.key("one");
//            jj.value(1.00);
//            jj.endObject();
//            jj.value(obj);
//            jj.endArray();
//            System.out.println(jj.toString());
//
//            System.out.println(new JSONArray(jj.toString()).toString(4));
//
//        	int ar[] = {1, 2, 3};
//        	JSONArray ja = new JSONArray(ar);
//        	System.out.println(ja.toString());
//        	
//        	String sa[] = {"aString", "aNumber", "aBoolean"};            
//            j = new JSONObject(obj, sa);
//            j.put("Testing JSONString interface", obj);
//            System.out.println(j.toString(4));          
//            
//            j = new JSONObject("{slashes: '///', closetag: '</script>', backslash:'\\\\', ei: {quotes: '\"\\''},eo: {a: '\"quoted\"', b:\"don't\"}, quotes: [\"'\", '\"']}");
//            System.out.println(j.toString(2));
//            System.out.println(XML.toString(j));
//            System.out.println("");
//
//            j = new JSONObject(
//                "/*comment*/{foo: [true, false,9876543210,    0.0, 1.00000001,  1.000000000001, 1.00000000000000001," +
//                " .00000000000000001, 2.00, 0.1, 2e100, -32,[],{}, \"string\"], " +
//                "  to   : null, op : 'Good'," +
//                "ten:10} postfix comment");
//            j.put("String", "98.6");
//            j.put("JSONObject", new JSONObject());
//            j.put("JSONArray", new JSONArray());
//            j.put("int", 57);
//            j.put("double", 123456789012345678901234567890.);
//            j.put("true", true);
//            j.put("false", false);
//            j.put("null", JSONObject.NULL);
//            j.put("bool", "true");
//            j.put("zero", -0.0);
//            j.put("\\u2028", "\u2028");
//            j.put("\\u2029", "\u2029");
//            a = j.getJSONArray("foo");
//            a.put(666);
//            a.put(2001.99);
//            a.put("so \"fine\".");
//            a.put("so <fine>.");
//            a.put(true);
//            a.put(false);
//            a.put(new JSONArray());
//            a.put(new JSONObject());
//            j.put("keys", JSONObject.getNames(j));
//            System.out.println(j.toString(4));
//            System.out.println(XML.toString(j));
//
//            System.out.println("String: " + j.getDouble("String"));
//            System.out.println("  bool: " + j.getBoolean("bool"));
//            System.out.println("    to: " + j.getString("to"));
//            System.out.println("  true: " + j.getString("true"));
//            System.out.println("   foo: " + j.getJSONArray("foo"));
//            System.out.println("    op: " + j.getString("op"));
//            System.out.println("   ten: " + j.getInt("ten"));
//            System.out.println("  oops: " + j.optBoolean("oops"));
//
//            s = "<xml one = 1 two=' \"2\" '><five></five>First \u0009&lt;content&gt;<five></five> This is \"content\". <three>  3  </three>JSON does not preserve the sequencing of elements and contents.<three>  III  </three>  <three>  T H R E E</three><four/>Content text is an implied structure in XML. <six content=\"6\"/>JSON does not have implied structure:<seven>7</seven>everything is explicit.<![CDATA[CDATA blocks<are><supported>!]]></xml>";
//            j = XML.toJSONObject(s);
//            System.out.println(j.toString(2));
//            System.out.println(XML.toString(j));
//            System.out.println("");
//            
//            ja = JSONML.toJSONArray(s);
//            System.out.println(ja.toString(4));
//            System.out.println(JSONML.toString(ja));
//            System.out.println("");
//            
//            s = "<xml do='0'>uno<a re='1' mi='2'>dos<b fa='3'/>tres<c></c>quatro</a>cinqo<d>seis<e/></d></xml>";
//            ja = JSONML.toJSONArray(s);
//            System.out.println(ja.toString(4));
//            System.out.println(JSONML.toString(ja));
//            System.out.println("");
//
//            s = "<mapping><empty/>   <class name = \"Customer\">      <field name = \"ID\" type = \"string\">         <bind-xml name=\"ID\" node=\"attribute\"/>      </field>      <field name = \"FirstName\" type = \"FirstName\"/>      <field name = \"MI\" type = \"MI\"/>      <field name = \"LastName\" type = \"LastName\"/>   </class>   <class name = \"FirstName\">      <field name = \"text\">         <bind-xml name = \"text\" node = \"text\"/>      </field>   </class>   <class name = \"MI\">      <field name = \"text\">         <bind-xml name = \"text\" node = \"text\"/>      </field>   </class>   <class name = \"LastName\">      <field name = \"text\">         <bind-xml name = \"text\" node = \"text\"/>      </field>   </class></mapping>";
//            j = XML.toJSONObject(s);
//
//            System.out.println(j.toString(2));
//            System.out.println(XML.toString(j));
//            System.out.println("");
//            ja = JSONML.toJSONArray(s);
//            System.out.println(ja.toString(4));
//            System.out.println(JSONML.toString(ja));
//            System.out.println("");
//
//            j = XML.toJSONObject("<?xml version=\"1.0\" ?><Book Author=\"Anonymous\"><Title>Sample Book</Title><Chapter id=\"1\">This is chapter 1. It is not very long or interesting.</Chapter><Chapter id=\"2\">This is chapter 2. Although it is longer than chapter 1, it is not any more interesting.</Chapter></Book>");
//            System.out.println(j.toString(2));
//            System.out.println(XML.toString(j));
//            System.out.println("");
//
//            j = XML.toJSONObject("<!DOCTYPE bCard 'http://www.cs.caltech.edu/~adam/schemas/bCard'><bCard><?xml default bCard        firstname = ''        lastname  = '' company   = '' email = '' homepage  = ''?><bCard        firstname = 'Rohit'        lastname  = 'Khare'        company   = 'MCI'        email     = 'khare@mci.net'        homepage  = 'http://pest.w3.org/'/><bCard        firstname = 'Adam'        lastname  = 'Rifkin'        company   = 'Caltech Infospheres Project'        email     = 'adam@cs.caltech.edu'        homepage  = 'http://www.cs.caltech.edu/~adam/'/></bCard>");
//            System.out.println(j.toString(2));
//            System.out.println(XML.toString(j));
//            System.out.println("");
//
//            j = XML.toJSONObject("<?xml version=\"1.0\"?><customer>    <firstName>        <text>Fred</text>    </firstName>    <ID>fbs0001</ID>    <lastName> <text>Scerbo</text>    </lastName>    <MI>        <text>B</text>    </MI></customer>");
//            System.out.println(j.toString(2));
//            System.out.println(XML.toString(j));
//            System.out.println("");
//
//            j = XML.toJSONObject("<!ENTITY tp-address PUBLIC '-//ABC University::Special Collections Library//TEXT (titlepage: name and address)//EN' 'tpspcoll.sgm'><list type='simple'><head>Repository Address </head><item>Special Collections Library</item><item>ABC University</item><item>Main Library, 40 Circle Drive</item><item>Ourtown, Pennsylvania</item><item>17654 USA</item></list>");
//            System.out.println(j.toString());
//            System.out.println(XML.toString(j));
//            System.out.println("");
//
//            j = XML.toJSONObject("<test intertag status=ok><empty/>deluxe<blip sweet=true>&amp;&quot;toot&quot;&toot;&#x41;</blip><x>eks</x><w>bonus</w><w>bonus2</w></test>");
//            System.out.println(j.toString(2));
//            System.out.println(XML.toString(j));
//            System.out.println("");
//
//            j = HTTP.toJSONObject("GET / HTTP/1.0\nAccept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*\nAccept-Language: en-us\nUser-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90; T312461; Q312461)\nHost: www.nokko.com\nConnection: keep-alive\nAccept-encoding: gzip, deflate\n");
//            System.out.println(j.toString(2));
//            System.out.println(HTTP.toString(j));
//            System.out.println("");
//
//            j = HTTP.toJSONObject("HTTP/1.1 200 Oki Doki\nDate: Sun, 26 May 2002 17:38:52 GMT\nServer: Apache/1.3.23 (Unix) mod_perl/1.26\nKeep-Alive: timeout=15, max=100\nConnection: Keep-Alive\nTransfer-Encoding: chunked\nContent-Type: text/html\n");
//            System.out.println(j.toString(2));
//            System.out.println(HTTP.toString(j));
//            System.out.println("");
//
//            j = new JSONObject("{nix: null, nux: false, null: 'null', 'Request-URI': '/', Method: 'GET', 'HTTP-Version': 'HTTP/1.0'}");
//            System.out.println(j.toString(2));
//            System.out.println("isNull: " + j.isNull("nix"));
//            System.out.println("   has: " + j.has("nix"));
//            System.out.println(XML.toString(j));
//            System.out.println(HTTP.toString(j));
//            System.out.println("");
//
//            j = XML.toJSONObject("<?xml version='1.0' encoding='UTF-8'?>"+"\n\n"+"<SOAP-ENV:Envelope"+
//              " xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\""+
//              " xmlns:xsi=\"http://www.w3.org/1999/XMLSchema-instance\""+
//              " xmlns:xsd=\"http://www.w3.org/1999/XMLSchema\">"+
//              "<SOAP-ENV:Body><ns1:doGoogleSearch"+
//              " xmlns:ns1=\"urn:GoogleSearch\""+
//              " SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">"+
//              "<key xsi:type=\"xsd:string\">GOOGLEKEY</key> <q"+
//              " xsi:type=\"xsd:string\">'+search+'</q> <start"+
//              " xsi:type=\"xsd:int\">0</start> <maxResults"+
//              " xsi:type=\"xsd:int\">10</maxResults> <filter"+
//              " xsi:type=\"xsd:boolean\">true</filter> <restrict"+
//              " xsi:type=\"xsd:string\"></restrict> <safeSearch"+
//              " xsi:type=\"xsd:boolean\">false</safeSearch> <lr"+
//              " xsi:type=\"xsd:string\"></lr> <ie"+
//              " xsi:type=\"xsd:string\">latin1</ie> <oe"+
//              " xsi:type=\"xsd:string\">latin1</oe>"+
//              "</ns1:doGoogleSearch>"+
//              "</SOAP-ENV:Body></SOAP-ENV:Envelope>");
//            System.out.println(j.toString(2));
//            System.out.println(XML.toString(j));
//            System.out.println("");
//
//            j = new JSONObject("{Envelope: {Body: {\"ns1:doGoogleSearch\": {oe: \"latin1\", filter: true, q: \"'+search+'\", key: \"GOOGLEKEY\", maxResults: 10, \"SOAP-ENV:encodingStyle\": \"http://schemas.xmlsoap.org/soap/encoding/\", start: 0, ie: \"latin1\", safeSearch:false, \"xmlns:ns1\": \"urn:GoogleSearch\"}}}}");
//            System.out.println(j.toString(2));
//            System.out.println(XML.toString(j));
//            System.out.println("");
            
        	JSONObject k = new JSONObject("{\"totalRecord\":5147,\"allCount\":5147,\"needSeries\":false,\"data\":[{\"orderTimes\":\"330\",\"channelId\":\"1007\",\"servtype\":\"8\",\"infoUrl\":\"/1007/300000014784.html?p=24436889\",\"produceCode\":\"100002358104457100000010759300000014784\",\"appcateid\":\"40\",\"cateName\":\"软件\",\"sortName\":\"聊天\",\"imageName3\":\"http://u5.mm-img.com/rs/res/21/a952/284/284952/WWWPropaPicture3.jpg\",\"parentid\":\"24436889\",\"chargeTime\":\"1\",\"name\":\"短信无忧\",\"mmspeed\":\"0\",\"descript\":\"“短信无忧”为您提供以下功能：\r\n\r\n1.短信群发，选择通讯录中的联系人或自建群组，输入短信内容，然后软件会为你逐一发送，并显示发送结果；\r\n2.自建联系人群组，在通讯录中选择联系人，建立群组，方便您对联系人的管理，需要群发短信的时候，直接选择群组即可（如家人、同事、客户...）；\r\n3.发送记录，您能快捷查看每一笔发送记录（包括短信内容、接收人等）；\r\n4.激发灵感，短信无忧为您提供了各类型热门短信内容作为参考，激发您的创意灵感；\r\n\r\n欢迎您使用，同时非常期待您的宝贵意见，我希望能够为您做的更好，谢谢！\r\n温馨提示：如应用出现网络不能连接问题，请通过手机上的“设置-->数据连接-->（勾选）开机时连接-->重新运行应用软件”\",\"spName\":\"郑波\",\"platform\":\"{ophone os}\",\"mPrice\":\"0.99\",\"contentId\":\"300000014784\",\"averageMark\":\"1\",\"seriescount\":0,\"imageName1\":\"http://u5.mm-img.com/rs/res/21/a950/284/284950/WWWPropaPicture1.jpg\",\"imageName2\":\"http://u5.mm-img.com/rs/res/21/a951/284/284951/WWWPropaPicture2_new.png\",\"dPrice\":\"0.00\",\"lupddate\":\"2010-08-18 09:51:19\",\"scantimes\":\"3013\",\"categoryId\":\"24436889\",\"isSupportDotcard\":\"0\",\"xType\":\"nt:gcontent:appSoftWare\"},{\"orderTimes\":\"30\",\"channelId\":\"1007\",\"servtype\":\"8\",\"infoUrl\":\"/1007/300000036003.html?p=24436852\",\"produceCode\":\"100002321101011100000024091300000036003\",\"appcateid\":\"38\",\"cateName\":\"软件\",\"sortName\":\"医疗\",\"imageName3\":\"http://u5.mm-img.com/rs/res/21/a874/601/601874/WWWPropaPicture3.jpg\",\"parentid\":\"24436852\",\"chargeTime\":\"1\",\"name\":\"快乐戒烟\",\"mmspeed\":\"0\",\"descript\":\"烟草对人类健康危害深重,很多人吸烟上瘾,欲罢 不能,而且是越陷越深。[快乐戒烟]提供了一种安全有效的全新戒烟方法。\r\n [快乐戒烟]由专注于BBT生物效应研究的MediSound实验室提供技术支持。该软件采用最新的数字音频合成技术，针对特定目标精确调制声波频率，通过BBT技术（Binaural Beats Technology，双音拍技术）帮助诱导人脑自身合成并分泌多种神经内分泌激素，显著提高内啡肽（脑啡肽）水平，同时还能通过调整脑电波模式诱导睡眠、镇静安神、从内心深处缓解压力、提高生活质量、增强幸福感，从而达到快乐戒烟的目的。\r\n \r\n 挖掘潜能，再现生命活力。自力更生，做自己的医生。\r\n 请使用前认真阅读本软件附带的相关文字资料。\",\"spName\":\"珠海市奥美软件科技有限公司\",\"platform\":\"{ophone os}\",\"mPrice\":\"2.99\",\"contentId\":\"300000036003\",\"averageMark\":\"3\",\"seriescount\":0,\"imageName2\":\"http://u5.mm-img.com/rs/res/21/a873/601/601873/WWWPropaPicture2_new.png\",\"dPrice\":\"0.00\",\"lupddate\":\"2010-08-12 23:30:07\",\"scantimes\":\"207\",\"categoryId\":\"24436852\",\"isSupportDotcard\":\"0\",\"xType\":\"nt:gcontent:appSoftWare\"},{\"orderTimes\":\"429\",\"channelId\":\"1007\",\"servtype\":\"8\",\"recommendreason\":\"这是一款地图搜索城市定位导航软件，真正实现了移动互联网快速定位导航。\",\"infoUrl\":\"/1007/300000032785.html?p=24436850\",\"produceCode\":\"100002319104934100000026558300000032785\",\"appcateid\":\"37\",\"cateName\":\"软件\",\"sortName\":\"地图\",\"imageName3\":\"http://u5.mm-img.com/rs/res/21/a067/559/559067/WWWPropaPicture3.jpg\",\"parentid\":\"24436850\",\"chargeTime\":\"1\",\"name\":\"Hicity\",\"mmspeed\":\"0\",\"descript\":\"Hicity是一款基于OPone版手机所开发的地图定位手机端软件，为市民供食、玩、行及同城交流与互动等丰富的全方位信息。助力于为广大市民提供便民信息查询、城市生活导航、自我定位、定位他人、搜索周边等，真正做到随时随地进行移动互联网冲浪。\r\n\r\n温馨提示：如应用出现网络不能连接问题，请通过手机上的“设置-->数据连接-->（勾选）开机时连接-->重新运行应用软件”\",\"spName\":\"北京高维信诚资讯有限公司上海分公司\",\"platform\":\"{ophone os}\",\"mPrice\":\"0.00\",\"contentId\":\"300000032785\",\"averageMark\":\"4\",\"recommendgrade\":\"87\",\"seriescount\":0,\"imageName2\":\"http://u5.mm-img.com/rs/res/21/a066/559/559066/WWWPropaPicture2_new.png\",\"recommendreasondetail\":\"Hicity是一款地图搜索城市定位导航软件，为用户提供了各种饮食，出行，住宿，日常生活的导航信息服务，帮您快速找到您想去的地方，并通过地图定位和文字说明的形式展现出来，让用户非常直观地了解具体方位。真正实现了移动互联网快速定位导航。\",\"dPrice\":\"0.00\",\"lupddate\":\"2010-08-05 20:40:27\",\"scantimes\":\"1197\",\"categoryId\":\"24436850\",\"isSupportDotcard\":\"0\",\"xType\":\"nt:gcontent:appSoftWare\"},{\"orderTimes\":\"7\",\"channelId\":\"1007\",\"servtype\":\"8\",\"infoUrl\":\"/1007/300000054017.html?p=24436849\",\"produceCode\":\"100002318111103100000042688300000054017\",\"appcateid\":\"36\",\"cateName\":\"软件\",\"sortName\":\"旅行\",\"imageName3\":\"http://u5.mm-img.com/rs/res/21/a438/824/824438/picture1135x1809703351245.jpg\",\"parentid\":\"24436849\",\"chargeTime\":\"1\",\"name\":\"韩国旅行指南\",\"mmspeed\":\"0\",\"descript\":\"韩国旅游有什么手续?\r\n需要注意什么?\r\n本应用提供韩国旅行指南。\",\"spName\":\"赵永玲\",\"platform\":\"{ophone os}\",\"mPrice\":\"0.00\",\"contentId\":\"300000054017\",\"averageMark\":\"3\",\"seriescount\":0,\"imageName2\":\"http://u5.mm-img.com/rs/res/21/a437/824/824437/logo470x709703390387.png\",\"dPrice\":\"0.00\",\"lupddate\":\"2010-08-30 00:06:53\",\"scantimes\":\"7\",\"categoryId\":\"24436849\",\"isSupportDotcard\":\"0\",\"xType\":\"nt:gcontent:appSoftWare\"},{\"orderTimes\":\"4\",\"channelId\":\"1007\",\"servtype\":\"8\",\"infoUrl\":\"/1007/300000045549.html?p=24436848\",\"produceCode\":\"100002317109246100000029970300000045549\",\"appcateid\":\"35\",\"cateName\":\"软件\",\"sortName\":\"书籍\",\"imageName3\":\"http://u5.mm-img.com/rs/res/21/a215/727/727215/picture1135x1805717167788.jpg\",\"parentid\":\"24436848\",\"chargeTime\":\"1\",\"name\":\"钢铁是怎样炼成的\",\"mmspeed\":\"0\",\"descript\":\"　　《钢铁是怎样炼成的》是苏联作家尼古拉·奥斯特洛夫斯基所著的一部长篇小说，于1933年写成。小说通过保尔.柯察金的成长道路，告诉人们，一个人只有在革命的艰难困苦中战胜敌人也战胜自己，只有在把自己的追求和祖国、人民的利益联系在一起的时候，才会创造出奇迹，才会成长为钢铁战士。\r\n　　随时随地体验外国名著的魅力，本软件收录了《钢铁是怎样炼成的》全集，方便你随时随地进行阅读！\",\"spName\":\"李晓华\",\"platform\":\"{ophone os}\",\"mPrice\":\"0.80\",\"contentId\":\"300000045549\",\"averageMark\":\"3\",\"seriescount\":0,\"imageName2\":\"http://u5.mm-img.com/rs/res/21/a214/727/727214/logo470x705717158515_new.png\",\"dPrice\":\"0.00\",\"lupddate\":\"2010-08-06 18:13:33\",\"scantimes\":\"12\",\"categoryId\":\"24436848\",\"isSupportDotcard\":\"0\",\"xType\":\"nt:gcontent:appSoftWare\"},{\"orderTimes\":\"0\",\"channelId\":\"1007\",\"servtype\":\"8\",\"infoUrl\":\"/1007/300000052621.html?p=24436846\",\"produceCode\":\"100002315113310100000037610300000052621\",\"appcateid\":\"33\",\"cateName\":\"软件\",\"sortName\":\"图像\",\"imageName3\":\"http://u5.mm-img.com/rs/res/21/a069/810/810069/picture1135x1809361229913.jpg\",\"parentid\":\"24436846\",\"chargeTime\":\"1\",\"name\":\"玉女吹竹箫翠袖朱唇\",\"mmspeed\":\"0\",\"descript\":\"玉女吹竹箫溪水畔，唯美画面让人陶醉。本应用为Widget软件。下载安装后，OPHONE1.5的手机，需要在手机屏幕空白处，长按会出来提示：应用程序，快捷方式，内置工具，外部工具，请在“外部工具”中选择本Widget应用可以欣赏本动画内容。下载安装后，OPHONE2.0的手机，在添加的新手机屏幕上，选择手机的“添加”功能，会出来提示：添加到主屏幕，快捷方式，小工具，文件夹，壁纸。在“小工具”中选择本Widget应用可以欣赏本动画内容。要是“外部工具”（或“小工具”）没有显示本Widget应用，需要将手机进行“主清除”，再重新安装后选择欣赏。要是手机提示“屏幕没有空间安装该组件”，需要添加手机屏幕或对手机进行“主清除”，再重新安装选择欣赏。\",\"spName\":\"王宏\",\"platform\":\"{ophone os}\",\"mPrice\":\"15.00\",\"contentId\":\"300000052621\",\"averageMark\":\"3\",\"seriescount\":0,\"imageName2\":\"http://u5.mm-img.com/rs/res/21/a068/810/810068/logo470x709361267379.png\",\"dPrice\":\"0.00\",\"lupddate\":\"2010-08-23 00:00:22\",\"scantimes\":\"21\",\"categoryId\":\"24436846\",\"isSupportDotcard\":\"0\",\"xType\":\"nt:gcontent:appSoftWare\"},{\"orderTimes\":\"2\",\"channelId\":\"1007\",\"servtype\":\"8\",\"infoUrl\":\"/1007/300000043520.html?p=24436843\",\"produceCode\":\"100002312108713100000028790300000043520\",\"appcateid\":\"32\",\"cateName\":\"软件\",\"sortName\":\"美化\",\"imageName3\":\"http://u5.mm-img.com/rs/res/21/a190/704/704190/WWWPropaPicture3.jpg\",\"parentid\":\"24436843\",\"chargeTime\":\"1\",\"name\":\"玩转桌面之爱意浓浓情人节主题\",\"mmspeed\":\"0\",\"descript\":\"你是否每天看到同样的手机桌面背景而感到厌倦？你是否因每天人工设置背景图而感到繁恼？玩转桌面软件是你的最佳之选，玩转桌面是一款桌面自动更换软件，你只需要一次性设置，启动服务后即可每天享受手机桌面新的美。\r\n 玩转桌面之爱意浓浓，趁着这个浪漫的节日,赶快跟你心爱的伴侣表达自己的心意吧!\r\n\r\n注意：软件启动服务是从启动时的日期向前算法，而不是往后算法，如果需要人工修改手机系统时间来立即查看效果，用户修改的手机时间必须是从当前时间向前设置（例如：如果当前启动服务时的日期是2号，人工修改手机系统后的日期为3号即可以立即看到效果），如果修改的手机时间是往后时间设置（例如：如果当前启动服务时的日期是2号，人工修改后日期为1号），必须还需要进入软件执行“开始玩转”功能才能立即查看效果。以上注意事项不会影响到软件功能正常使用，只针对用户修改手机系统日期的注意事项。\",\"spName\":\"广东亿俊计算机系统有限公司\",\"platform\":\"{ophone os}\",\"mPrice\":\"0.99\",\"contentId\":\"300000043520\",\"averageMark\":\"3\",\"seriescount\":0,\"imageName2\":\"http://u5.mm-img.com/rs/res/21/a189/704/704189/WWWPropaPicture2_new.png\",\"dPrice\":\"0.00\",\"lupddate\":\"2010-07-16 09:40:30\",\"scantimes\":\"36\",\"categoryId\":\"24436843\",\"isSupportDotcard\":\"0\",\"xType\":\"nt:gcontent:appSoftWare\"},{\"orderTimes\":\"766\",\"channelId\":\"1007\",\"servtype\":\"8\",\"infoUrl\":\"/1007/300000060510.html?p=24436841\",\"produceCode\":\"100002310110939100000038275300000060510\",\"appcateid\":\"30\",\"cateName\":\"软件\",\"sortName\":\"金融\",\"imageName3\":\"http://u5.mm-img.com/rs/res/21/a804/896/896804/picture1135x1801352522721.jpg\",\"parentid\":\"24436841\",\"chargeTime\":\"1\",\"name\":\"股市直播\",\"mmspeed\":\"1\",\"descript\":\"财经大赢家股市直播，内容涵盖最新财经资讯、每日股市直播、实战秘笈、理财故事等，为用户提供即时、权威、准确的财经内容产品平台，致力于成为用户首选的手机理财产品，做广大用户的贴身财经专家。 \",\"spName\":\"广东宇天信通通信科技有限公司\",\"platform\":\"{s60}\",\"mPrice\":\"0.00\",\"contentId\":\"300000060510\",\"averageMark\":\"5\",\"seriescount\":0,\"imageName2\":\"http://u5.mm-img.com/rs/res/21/a803/896/896803/logo470x701352489603.png\",\"dPrice\":\"0.00\",\"lupddate\":\"2010-08-12 00:00:04\",\"scantimes\":\"1523\",\"categoryId\":\"24436841\",\"isSupportDotcard\":\"0\",\"xType\":\"nt:gcontent:appSoftWare\"},{\"orderTimes\":\"73\",\"channelId\":\"1007\",\"servtype\":\"8\",\"infoUrl\":\"/1007/300000015780.html?p=24436839\",\"produceCode\":\"100002308105022100000010698300000015780\",\"appcateid\":\"27\",\"cateName\":\"软件\",\"sortName\":\"无线\",\"imageName3\":\"http://u5.mm-img.com/rs/res/21/a263/301/301263/WWWPropaPicture3.jpg\",\"parentid\":\"24436839\",\"chargeTime\":\"1\",\"name\":\"定时切换飞行模式\",\"mmspeed\":\"1\",\"descript\":\"\r\n定时切换飞行模式是指每天在指定时间使手机自动的进入离线模式（飞行模式），并且在指定的时间恢复到正常模式。现在的手机晚上很少有人关机，并且睡觉的时候都把手机放在旁边，日复一日，日积月累，这些辐射对身体，特别是大脑，会有一定的影响，并且半夜手机放在正常模式，对电量也是一种浪费，手机很大一部分的耗电量就是手机信号的辐射，还有就是半夜的无聊电话，半夜惊醒，却是一个无聊的陌生人电话。我想这些大家或多或少的都遇到过，而这款软件就是为了解决大家的这些烦恼而设计的。\",\"spName\":\"李小峰\",\"platform\":\"{windows mobile}\",\"mPrice\":\"2.00\",\"contentId\":\"300000015780\",\"averageMark\":\"3\",\"seriescount\":0,\"imageName1\":\"http://u5.mm-img.com/rs/res/21/a261/301/301261/WWWPropaPicture1.jpg\",\"imageName2\":\"http://u5.mm-img.com/rs/res/21/a262/301/301262/WWWPropaPicture2_new.png\",\"dPrice\":\"0.00\",\"lupddate\":\"2010-07-18 18:25:47\",\"scantimes\":\"927\",\"categoryId\":\"24436839\",\"isSupportDotcard\":\"0\",\"xType\":\"nt:gcontent:appSoftWare\"},{\"orderTimes\":\"179\",\"channelId\":\"1007\",\"servtype\":\"8\",\"infoUrl\":\"/1007/300000049047.html?p=7004\",\"produceCode\":\"100000013108713100000030739300000049047\",\"appcateid\":\"1\",\"cateName\":\"软件\",\"sortName\":\"系统\",\"imageName3\":\"http://u5.mm-img.com/rs/res/21/a632/769/769632/picture1135x1807452963988.jpg\",\"parentid\":\"7004\",\"chargeTime\":\"1\",\"name\":\"卸载管家\",\"mmspeed\":\"0\",\"descript\":\"最快，最简单，最专业的卸载工具！5大功能为您服务：\r\n您可以用关键字搜索要删除的软件，再也不用为列表太多软件而烦恼；\r\n您可以按名称、日期、大小来排序软件，让您最快找到最浪费你内存的软件；\r\n您可以图标放置在通知栏（此功能在“设置”中勾选后启动），让您不用到处找快捷方式，一步就到卸载管家；\r\n实现更详细的软件列表信息，把软件的名称、安装时间、大小显示出来；\r\n保护影响手机使用的程序不被您误删。\",\"spName\":\"广东亿俊计算机系统有限公司\",\"platform\":\"{ophone os},{android}\",\"mPrice\":\"1.80\",\"contentId\":\"300000049047\",\"averageMark\":\"5\",\"seriescount\":0,\"imageName2\":\"http://u5.mm-img.com/rs/res/21/a631/769/769631/logo470x707452951077.png\",\"dPrice\":\"0.00\",\"lupddate\":\"2010-08-10 20:26:02\",\"scantimes\":\"863\",\"categoryId\":\"7004\",\"isSupportDotcard\":\"0\",\"xType\":\"nt:gcontent:appSoftWare\"},{\"orderTimes\":\"15971\",\"channelId\":\"1007\",\"servtype\":\"8\",\"recommendreason\":\"画面精美，具有专业的体育信息，让你不会错过任何一个精彩赛事。\",\"infoUrl\":\"/1007/300000044169.html?p=7005\",\"produceCode\":\"100000014112680100000028463300000044169\",\"appcateid\":\"29\",\"cateName\":\"软件\",\"sortName\":\"资讯\",\"imageName3\":\"http://u5.mm-img.com/rs/res/21/a325/712/712325/picture1135x1805361181858.jpg\",\"parentid\":\"7005\",\"chargeTime\":\"1\",\"name\":\"体坛周报客户端\",\"mmspeed\":\"1\",\"descript\":\"体坛周报手机客户端产品依托《体坛周报》、《足球周刊》、《扣篮》等体坛系报刊的权威内容，通过手机客户端为用户提供最新鲜的体坛资讯，以及原汁原味的体坛系报刊精彩内容。体坛名记马德兴、颜强、杨毅等也将在第一时间通过手机对焦点体育事件进行深度评论，并通过手机社区及群组功能与球迷进行零距离交流，打造最具人气的手机互动平台。\r\n温馨提示：如应用出现网络不能连接问题，请通过手机上的“设置-->数据连接-->（勾选）开机时连接-->重新运行应用软件”\",\"spName\":\"湖南体坛文化传播有限责任公司\",\"platform\":\"{windows mobile},{ophone os},{android},{s60},{kjava}\",\"mPrice\":\"0.00\",\"contentId\":\"300000044169\",\"averageMark\":\"4\",\"recommendgrade\":\"87\",\"seriescount\":0,\"imageName2\":\"http://u5.mm-img.com/rs/res/21/a324/712/712324/logo470x705361144382_new.png\",\"recommendreasondetail\":\"当世界杯如火如荼地进行时，我们看到了体坛快报发挥了软件优势，将世界杯的所有方面信息都整合在软件中，打开软件，球迷们不仅仅可以查看有关世界杯的近况新闻，同时还可以查看赛事的进程和赛事的文字直播，如果你觉得还不过瘾，可以在论坛中与其他网友进行激烈的讨论。\",\"dPrice\":\"0.00\",\"lupddate\":\"2010-08-06 14:00:51\",\"scantimes\":\"31359\",\"categoryId\":\"7005\",\"isSupportDotcard\":\"0\",\"xType\":\"nt:gcontent:appSoftWare\"},{\"orderTimes\":\"5\",\"channelId\":\"1007\",\"servtype\":\"8\",\"infoUrl\":\"/1007/300000014306.html?p=7008\",\"produceCode\":\"100000017103090100000010076300000014306\",\"appcateid\":\"39\",\"cateName\":\"软件\",\"sortName\":\"音乐\",\"imageName3\":\"http://u5.mm-img.com/rs/res/21/a712/275/275712/135.jpg\",\"parentid\":\"7008\",\"chargeTime\":\"1\",\"name\":\"《诗·歌·曲》音乐阅读版I母爱.谎言\",\"mmspeed\":\"1\",\"descript\":\"使用说明：\r\n1、安装一般在根目录下进行，安装（解压）检查完毕,打开文件管理器-WINDOWS是从”开始”进入的,打开《诗·歌·曲》-音乐阅读版I母爱.谎言-所在的文件夹,打开《诗·歌·曲》音乐阅读版I母爱.谎言.html文件阅读 。大文件包请在手机的内存卡上进行。\r\n2、支持智能手机全屏播放视频文件。\r\n3、支持文件：\r\n浏览器：IE等。\r\n播放器：Windows Media Player等。\r\n\",\"spName\":\"杨杰\",\"platform\":\"{windows mobile}\",\"mPrice\":\"1.90\",\"contentId\":\"300000014306\",\"averageMark\":\"3\",\"seriescount\":0,\"imageName1\":\"http://u5.mm-img.com/rs/res/21/a710/275/275710/160.jpg\",\"imageName2\":\"http://u5.mm-img.com/rs/res/21/a711/275/275711/70_new.png\",\"dPrice\":\"0.00\",\"lupddate\":\"2010-07-18 15:12:31\",\"scantimes\":\"10\",\"categoryId\":\"7008\",\"isSupportDotcard\":\"0\",\"xType\":\"nt:gcontent:appSoftWare\"}],\"ret\":0}");
//            System.out.println(k.toString(2));
//            System.out.println(XML.toString(k));
//            System.out.println("");
            

//            j = CookieList.toJSONObject("  f%oo = b+l=ah  ; o;n%40e = t.wo ");
//            System.out.println(j.toString(2));
//            System.out.println(CookieList.toString(j));
//            System.out.println("");
//
//            j = Cookie.toJSONObject("f%oo=blah; secure ;expires = April 24, 2002");
//            System.out.println(j.toString(2));
//            System.out.println(Cookie.toString(j));
//            System.out.println("");
//
//            j = new JSONObject("{script: 'It is not allowed in HTML to send a close script tag in a string<script>because it confuses browsers</script>so we insert a backslash before the /'}");
//            System.out.println(j.toString());
//            System.out.println("");
//
//            JSONTokener jt = new JSONTokener("{op:'test', to:'session', pre:1}{op:'test', to:'session', pre:2}");
//            j = new JSONObject(jt);
//            System.out.println(j.toString());
//            System.out.println("pre: " + j.optInt("pre"));
//            int i = jt.skipTo('{');
//            System.out.println(i);
//            j = new JSONObject(jt);
//            System.out.println(j.toString());
//            System.out.println("");
//
//            a = CDL.toJSONArray("No quotes, 'Single Quotes', \"Double Quotes\"\n1,'2',\"3\"\n,'It is \"good,\"', \"It works.\"\n\n");
//
//            System.out.println(CDL.toString(a));
//            System.out.println("");
//            System.out.println(a.toString(4));
//            System.out.println("");
//
//            a = new JSONArray(" [\"<escape>\", next is an implied null , , ok,] ");
//            System.out.println(a.toString());
//            System.out.println("");
//            System.out.println(XML.toString(a));
//            System.out.println("");
//
//            j = new JSONObject("{ fun => with non-standard forms ; forgiving => This package can be used to parse formats that are similar to but not stricting conforming to JSON; why=To make it easier to migrate existing data to JSON,one = [[1.00]]; uno=[[{1=>1}]];'+':+6e66 ;pluses=+++;empty = '' , 'double':0.666,true: TRUE, false: FALSE, null=NULL;[true] = [[!,@;*]]; string=>  o. k. ; # comment\r oct=0666; hex=0x666; dec=666; o=0999; noh=0x0x}");
//            System.out.println(j.toString(4));
//            System.out.println("");
//            if (j.getBoolean("true") && !j.getBoolean("false")) {
//                System.out.println("It's all good");
//            }
//
//            System.out.println("");
//            j = new JSONObject(j, new String[]{"dec", "oct", "hex", "missing"});
//            System.out.println(j.toString(4));
//
//            System.out.println("");
//            System.out.println(new JSONStringer().array().value(a).value(j).endArray());
//
//            j = new JSONObject("{string: \"98.6\", long: 2147483648, int: 2147483647, longer: 9223372036854775807, double: 9223372036854775808}");
//            System.out.println(j.toString(4));
//
//            System.out.println("\ngetInt");
//            System.out.println("int    " + j.getInt("int"));
//            System.out.println("long   " + j.getInt("long"));
//            System.out.println("longer " + j.getInt("longer"));
//            System.out.println("double " + j.getInt("double"));
//            System.out.println("string " + j.getInt("string"));
//
//            System.out.println("\ngetLong");
//            System.out.println("int    " + j.getLong("int"));
//            System.out.println("long   " + j.getLong("long"));
//            System.out.println("longer " + j.getLong("longer"));
//            System.out.println("double " + j.getLong("double"));
//            System.out.println("string " + j.getLong("string"));
//
//            System.out.println("\ngetDouble");
//            System.out.println("int    " + j.getDouble("int"));
//            System.out.println("long   " + j.getDouble("long"));
//            System.out.println("longer " + j.getDouble("longer"));
//            System.out.println("double " + j.getDouble("double"));
//            System.out.println("string " + j.getDouble("string"));
//
//            j.put("good sized", 9223372036854775807L);
//            System.out.println(j.toString(4));
//
//            a = new JSONArray("[2147483647, 2147483648, 9223372036854775807, 9223372036854775808]");
//            System.out.println(a.toString(4));
//
//            System.out.println("\nKeys: ");
//            it = j.keys();
//            while (it.hasNext()) {
//                s = (String)it.next();
//                System.out.println(s + ": " + j.getString(s));
//            }
//
//
//            System.out.println("\naccumulate: ");
//            j = new JSONObject();
//            j.accumulate("stooge", "Curly");
//            j.accumulate("stooge", "Larry");
//            j.accumulate("stooge", "Moe");
//            a = j.getJSONArray("stooge");
//            a.put(5, "Shemp");
//            System.out.println(j.toString(4));
//
//            System.out.println("\nwrite:");
//            System.out.println(j.write(new StringWriter()));
//
//            s = "<xml empty><a></a><a>1</a><a>22</a><a>333</a></xml>";
//            j = XML.toJSONObject(s);
//            System.out.println(j.toString(4));
//            System.out.println(XML.toString(j));
//            
//            s = "<book><chapter>Content of the first chapter</chapter><chapter>Content of the second chapter      <chapter>Content of the first subchapter</chapter>      <chapter>Content of the second subchapter</chapter></chapter><chapter>Third Chapter</chapter></book>";
//            j = XML.toJSONObject(s);
//            System.out.println(j.toString(4));
//            System.out.println(XML.toString(j));
//            
//            a = JSONML.toJSONArray(s);
//            System.out.println(a.toString(4));
//            System.out.println(JSONML.toString(a));
//            
//            Collection c = null;
//            Map m = null;
//            
//            j = new JSONObject(m);
//            a = new JSONArray(c);
//            j.append("stooge", "Joe DeRita");
//            j.append("stooge", "Shemp");
//            j.accumulate("stooges", "Curly");
//            j.accumulate("stooges", "Larry");
//            j.accumulate("stooges", "Moe");
//            j.accumulate("stoogearray", j.get("stooges"));
//            j.put("map", m);
//            j.put("collection", c);
//            j.put("array", a);
//            a.put(m);
//            a.put(c);
//            System.out.println(j.toString(4));
//            
//            s = "{plist=Apple; AnimalSmells = { pig = piggish; lamb = lambish; worm = wormy; }; AnimalSounds = { pig = oink; lamb = baa; worm = baa;  Lisa = \"Why is the worm talking like a lamb?\" } ; AnimalColors = { pig = pink; lamb = black; worm = pink; } } "; 
//            j = new JSONObject(s);
//            System.out.println(j.toString(4));
//            
//            s = " (\"San Francisco\", \"New York\", \"Seoul\", \"London\", \"Seattle\", \"Shanghai\")";
//            a = new JSONArray(s);
//            System.out.println(a.toString());
//            
//            s = "<a ichi='1' ni='2'><b>The content of b</b> and <c san='3'>The content of c</c><d>do</d><e></e><d>re</d><f/><d>mi</d></a>";
//            j = XML.toJSONObject(s);
//
//            System.out.println(j.toString(2));
//            System.out.println(XML.toString(j));
//            System.out.println("");
//            ja = JSONML.toJSONArray(s);
//            System.out.println(ja.toString(4));
//            System.out.println(JSONML.toString(ja));
//            System.out.println("");
//          
//            
//            System.out.println("\nTesting Exceptions: ");
//
//            System.out.print("Exception: ");
//            try {
//                a = new JSONArray();
//                a.put(Double.NEGATIVE_INFINITY);
//                a.put(Double.NaN);
//                System.out.println(a.toString());
//            } catch (Exception e) {
//                System.out.println(e);
//            }
//            System.out.print("Exception: ");
//            try {
//                System.out.println(j.getDouble("stooge"));
//            } catch (Exception e) {
//                System.out.println(e);
//            }
//            System.out.print("Exception: ");
//            try {
//                System.out.println(j.getDouble("howard"));
//            } catch (Exception e) {
//                System.out.println(e);
//            }
//            System.out.print("Exception: ");
//            try {
//                System.out.println(j.put(null, "howard"));
//            } catch (Exception e) {
//                System.out.println(e);
//            }
//            System.out.print("Exception: ");
//            try {
//                System.out.println(a.getDouble(0));
//            } catch (Exception e) {
//                System.out.println(e);
//            }
//            System.out.print("Exception: ");
//            try {
//                System.out.println(a.get(-1));
//            } catch (Exception e) {
//                System.out.println(e);
//            }
//            System.out.print("Exception: ");
//            try {
//                System.out.println(a.put(Double.NaN));
//            } catch (Exception e) {
//                System.out.println(e);
//            }
//            System.out.print("Exception: ");
//            try {
//            	j = XML.toJSONObject("<a><b>    ");
//            } catch (Exception e) {
//            	System.out.println(e);
//            }            
//            System.out.print("Exception: ");
//            try {
//            	j = XML.toJSONObject("<a></b>    ");
//            } catch (Exception e) {
//            	System.out.println(e);
//            }            
//            System.out.print("Exception: ");
//            try {
//            	j = XML.toJSONObject("<a></a    ");
//            } catch (Exception e) {
//            	System.out.println(e);
//            }
//            System.out.print("Exception: ");
//            try {            	
//            	ja = new JSONArray(new Object());
//            	System.out.println(ja.toString());
//            } catch (Exception e) {
//            	System.out.println(e);
//            }
//
//            System.out.print("Exception: ");
//            try {            	
//            	s = "[)";
//            	a = new JSONArray(s);
//            	System.out.println(a.toString());
//            } catch (Exception e) {
//            	System.out.println(e);
//            }
//
//            System.out.print("Exception: ");
//            try {            	
//                s = "<xml";
//                ja = JSONML.toJSONArray(s);
//                System.out.println(ja.toString(4));
//            } catch (Exception e) {
//            	System.out.println(e);
//            }
//
//            System.out.print("Exception: ");
//            try {            	
//                s = "<right></wrong>";
//                ja = JSONML.toJSONArray(s);
//                System.out.println(ja.toString(4));
//            } catch (Exception e) {
//            	System.out.println(e);
//            }
        } catch (Exception e) {
            System.out.println(e.toString());
        }
    }
}
